/*
 * CharacterStats.cpp
 *
 *  Created on: Oct 8, 2011
 *  Created by: Devin Manno
 *  Updated by: Devin Manno, Nick James,
 *	Last Update: Nov 19, 2011
 */

#include "CharacterStats.h"

CharacterStats::CharacterStats() {
	level = 1;							// start at level 1
	actionPoints = maxActionPoints;		// start with full action points
	hitPoints = maxHitPoints;			// start with full hit points
	initiative = 1;						// default to minimum initiative
}

CharacterStats::~CharacterStats() {
	// TODO Auto-generated destructor stub
}

// getters
int CharacterStats::getLevel() const{
	return level;
}

int CharacterStats::getHitPoints() const{
	return hitPoints; 
}

int CharacterStats::getActionPoints() const{
	return actionPoints; 
}

int CharacterStats::getInitiative() const {
    return initiative;
}

// setters
void CharacterStats::setCharacterStats(int agil, int str, int intel,
		int conc, int maxAP, int maxHP, int lvl, int AP, int HP){
	setStats(agil, str, intel, conc, maxAP, maxHP);
	level = lvl;
	actionPoints = AP;
	hitPoints = HP;

}

void CharacterStats::setInitiative(int initiativeToSet) {
    if(initiativeToSet <= 0)
    	initiative = 1;
    else if(initiativeToSet > 3)
    	initiative = 3;
    else
    	initiative = initiativeToSet;
}
void CharacterStats::setLevel(int lev){
	level = lev;
}

void CharacterStats::setHitPoints(int hit){
	hitPoints = hit; 
}

void CharacterStats::setActionPoints(int act){
	actionPoints = act; 
}


int CharacterStats::increaseHitPoints(int hp){
	if((hitPoints+hp) < getMaxHitPoints())
		hitPoints += hp;
	else
		hitPoints = getMaxHitPoints();
	return hitPoints;
}

int CharacterStats::increaseActionPoints(int ap){
	if((actionPoints+ap) < getMaxActionPoints())
		actionPoints += ap;
	else
		actionPoints = getMaxActionPoints();
	return actionPoints;
}
